package request

import (
	"gitee.com/cjsn/topsdk/util"
)

type AlipayBaoxianClaimUploadattachmentRequest struct {
	/*
	   外部业务号，唯一     */
	OutBizNo *string `json:"out_biz_no" required:"true" `
	/*
	   业务来源     */
	BizSource *string `json:"biz_source,omitempty" required:"false" `
	/*
	   标准产品ID     */
	SpNo *string `json:"sp_no,omitempty" required:"false" `
	/*
	   文件名,必须带后缀名。例如：test.png,test.doc,test.pdf     */
	AttachmentKey *string `json:"attachment_key" required:"true" `
	/*
	   文件字节数组     */
	AttachmentByte *[]byte `json:"attachment_byte" required:"true" `
	/*
	   是否base格式的字节数组     */
	Base64Bytes *bool `json:"base64_bytes,omitempty" required:"false" `
	/*
	   保单外部业务单号     */
	PolicyBizNo *string `json:"policy_biz_no,omitempty" required:"false" `
	/*
	   上传者用户标识     */
	UploadUser *string `json:"upload_user" required:"true" `
}

func (s *AlipayBaoxianClaimUploadattachmentRequest) SetOutBizNo(v string) *AlipayBaoxianClaimUploadattachmentRequest {
	s.OutBizNo = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetBizSource(v string) *AlipayBaoxianClaimUploadattachmentRequest {
	s.BizSource = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetSpNo(v string) *AlipayBaoxianClaimUploadattachmentRequest {
	s.SpNo = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetAttachmentKey(v string) *AlipayBaoxianClaimUploadattachmentRequest {
	s.AttachmentKey = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetAttachmentByte(v []byte) *AlipayBaoxianClaimUploadattachmentRequest {
	s.AttachmentByte = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetBase64Bytes(v bool) *AlipayBaoxianClaimUploadattachmentRequest {
	s.Base64Bytes = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetPolicyBizNo(v string) *AlipayBaoxianClaimUploadattachmentRequest {
	s.PolicyBizNo = &v
	return s
}
func (s *AlipayBaoxianClaimUploadattachmentRequest) SetUploadUser(v string) *AlipayBaoxianClaimUploadattachmentRequest {
	s.UploadUser = &v
	return s
}

func (req *AlipayBaoxianClaimUploadattachmentRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.OutBizNo != nil {
		paramMap["out_biz_no"] = *req.OutBizNo
	}
	if req.BizSource != nil {
		paramMap["biz_source"] = *req.BizSource
	}
	if req.SpNo != nil {
		paramMap["sp_no"] = *req.SpNo
	}
	if req.AttachmentKey != nil {
		paramMap["attachment_key"] = *req.AttachmentKey
	}
	if req.Base64Bytes != nil {
		paramMap["base64_bytes"] = *req.Base64Bytes
	}
	if req.PolicyBizNo != nil {
		paramMap["policy_biz_no"] = *req.PolicyBizNo
	}
	if req.UploadUser != nil {
		paramMap["upload_user"] = *req.UploadUser
	}
	return paramMap
}

func (req *AlipayBaoxianClaimUploadattachmentRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	if req.AttachmentByte != nil {
		fileMap["attachment_byte"] = *req.AttachmentByte
	}
	return fileMap
}
